// 表格列
import tagRender from '@/components/aggridCellRenDerer/tagRender.vue'


let tableColumns: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '报废单号',
        field: 'scrapCode',
        width: 250,
    },
    {
        headerName: '报废公司',
        field: 'companyName',
        width: 250,
    },
    {
        headerName: '报废部门',
        field: 'departmentName',
        width: 250,
    },
    {
        headerName: '创建人',
        field: 'createName',
        width: 250,
    },
    {
        headerName: '创建时间',
        field: 'createTime',
        width: 250,
    },
    {
        headerName: '修改人',
        field: 'updateName',
        width: 250,
    },
    {
        headerName: '修改时间',
        field: 'updateTime',
        width: 250,
    },
    {
        headerName: '是否固定资产',
        field: 'fixAssetStatus',
        width: 250,
        valueGetter: (params: any) => {
            return params.data.fixAssetStatus == 0 ?
                '否'
                : params.data.fixAssetStatus == 1 ?
                    '是' :

                    ''
        }
    },
    {
        headerName: '审核状态',
        field: 'auditState',
        width: 250,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.auditState == 0
                    ? 'warning'
                    : params.auditState == 1
                        ? 'success'
                        : params.auditState == 2
                            ? 'info'
                            : ''
            },
            text: (params: any) => {
                return params.auditState == 0
                    ? '待审核'
                    : params.auditState == 1
                        ? '审核通过'
                        : params.auditState == 2
                            ? '审核驳回'
                            : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '待审核'
                    : params.value == '1'
                        ? '审核通过'
                        : params.value == '2'
                            ? '审核驳回'
                            : ''
            },
        }
    },
    // {
    //     headerName: '建立人',
    //     field: 'createName',
    //     width: 200,
    // },
    // {
    //     headerName: '创建时间',
    //     field: 'createTime',
    //     width: 200,
    // },
    // {
    //     headerName: '修改人',
    //     field: 'updateName',
    //     width: 200,
    // },
    // {
    //     headerName: '修改时间',
    //     field: 'updateTime',
    //     width: 200,
    // }
]
let tableColumns1: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '报废单号',
        field: 'scrapCode',
        width: 250,
    },
    {
        headerName: '报废公司',
        field: 'companyName',
        width: 250,
    },
    {
        headerName: '报废时间',
        field: 'createTime',
        width: 250,
    },
    {
        headerName: '报废人',
        field: 'scrapPerson',
        width: 250,
    },
    {
        headerName: '处理状态',
        field: 'processedState',
        width: 250,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.auditState == 0
                    ? 'warning'
                    : params.auditState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.auditState == 0
                    ? '待处理'
                    : params.auditState == 1
                        ? '已处理'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '待审核'
                    : params.value == '1'
                        ? '审核通过'
                        : params.value == '2'
                            ? '审核驳回'
                            : ''
            },
        }
    },
]
// let tableColumns1: any = [
//     {
//         headerCheckboxSelection: true,
//         checkboxSelection: true,
//         width: 60,
//         showDisabledCheckboxes: false,
//         pinned: 'left',
//     },
//     {
//         headerName: '报废单号',
//         field: 'scrapCode',
//         width: 200,
//     },
//     {
//         headerName: '报废公司',
//         field: 'companyName',
//         width: 200,
//     },
//     {
//         headerName: '机台名称',
//         field: 'materialName',
//         width: 200,
//     },
//     {
//         headerName: '机台区域',
//         field: 'district',
//         width: 200,
//     },
//     {
//         headerName: '入厂时间',
//         field: 'joinFactoryTime',
//         width: 200,
//     },
//     {
//         headerName: '报废时间',
//         field: 'scrapTime',
//         width: 200,
//     },
//     {
//         headerName: '折旧时间',
//         field: 'deprecitionTime',
//         width: 200,
//     },
//     {
//         headerName: '已折旧时间',
//         field: 'upDeprecitionTime',
//         width: 200,
//     },
//     {
//         headerName: '折旧差异',
//         field: 'difference',
//         width: 200,
//     },
//     {
//         headerName: '建立人',
//         field: 'createName',
//         width: 200,
//     },
//     {
//         headerName: '创建时间',
//         field: 'createTime',
//         width: 200,
//     },
//     {
//         headerName: '修改人',
//         field: 'updateName',
//         width: 200,
//     },
//     {
//         headerName: '修改时间',
//         field: 'updateTime',
//         width: 200,
//     },
//     {
//         headerName: '备注',
//         field: 'remark',
//         width: 200,
//     },
//     {
//         headerName: '审核状态',
//         field: 'auditState',
//         width: 200,
//         cellRenderer: tagRender,
//         cellRendererParams: {
//             styleClass: (params: any) => {
//                 return params.auditState == 0
//                     ? 'warning'
//                     : params.auditState == 1
//                         ? 'success'
//                         : params.auditState == 2
//                             ? 'info'
//                             : ''
//             },
//             text: (params: any) => {
//                 return params.auditState == 0
//                     ? '待审核'
//                     : params.auditState == 1
//                         ? '审核通过'
//                         : params.auditState == 2
//                             ? '审核驳回'
//                             : ''
//             },
//             eltagSize: 0,
//         },
//     },

// ]
// 表格列
let tableColumns2: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '报废单号',
        field: 'scrapCode',
        width: 200,
    },
    {
        headerName: '报废公司',
        field: 'companyName',
        width: 200,
    },
    {
        headerName: '机台名称',
        field: 'materialName',
        width: 200,
    },
    {
        headerName: '机台区域',
        field: 'district',
        width: 200,
    },
    {
        headerName: '报废方式',
        field: 'scrapWay',
        width: 200,
    },
    {
        headerName: '报废金额',
        field: 'scrapMoney',
        width: 200,
    },
    {
        headerName: '入厂时间',
        field: 'joinFactoryTime',
        width: 200,
    },
    {
        headerName: '报废时间',
        field: 'scrapTime',
        width: 200,
    },
    {
        headerName: '折旧时间',
        field: 'deprecitionTime',
        width: 200,
    },
    {
        headerName: '折旧差异',
        field: 'difference',
        width: 200,
    },
    {
        headerName: '建立人',
        field: 'createName',
        width: 200,
    },
    {
        headerName: '创建时间',
        field: 'createTime',
        width: 200,
    },
    {
        headerName: '修改人',
        field: 'updateName',
        width: 200,
    },
    {
        headerName: '修改时间',
        field: 'updateTime',
        width: 200,
    },
    {
        headerName: '备注',
        field: 'remark',
        width: 200,
    },
    {
        headerName: '处理状态',
        field: 'processedState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.processedState == 0
                    ? 'warning'
                    : params.processedState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.processedState == 0
                    ? '未处理'
                    : params.processedState == 1
                        ? '已处理'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '未处理'
                    : params.value == '1'
                        ? '已处理'
                        : ''
            },
        }
    },
]

let tableColumns4: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: true,
        pinned: 'left',
    },
    // {
    //     headerName: '机台状态',
    //     field: 'machineState',
    //     width: 200,
    //     cellRenderer: tagRender,
    //     cellRendererParams: {
    //         styleClass: (params: any) => {
    //             return params.machineState == 0
    //                 ? 'warning'
    //                     : 'success'
    //         },
    //         text: (params: any) => {
    //             return params.machineState == 0
    //                 ? '未启动'
    //                 : params.machineState == 1
    //                     ? '待单'
    //                     : params.machineState == 2
    //                     ? '待纱'
    //                     : params.machineState == 3
    //                     ? '洗转机'
    //                     : params.machineState == 4
    //                     ? '运行'
    //                     : params.machineState == 5
    //                     ? '暂停'
    //                     : params.machineState == 6
    //                     ? '维修'
    //                     : params.machineState == 7
    //                     ? '保养'
    //                     : ''
    //         },
    //         eltagSize: 0,
    //     },
    //     filterParams:{
    //         valueFormatter: function (params: any) {
    //           return params.value == '0'
    //             ? '未启动'
    //             : params.value == '1'
    //             ? '待纱'
    //             : params.value == '2'
    //             ? '洗转机'
    //             : params.value == '3'
    //             ? '运行'
    //             : params.value == '4'
    //             ? '暂停'
    //             : params.value == '5'
    //             ? '维修'
    //             : params.value == '6'
    //             ? '保养'
    //             : ''
    //         },
    //       }
    // },
    // {
    //     headerName: '公司',
    //     field: 'companyName',
    //     width: 200,
    // },
    // {
    //     headerName: '部门名称',
    //     field: 'outDepartment',
    //     width: 200,
    // },
    {
        headerName: '物料大类',
        field: 'majorCategory',
        width: 150,
    },
    {
        headerName: '物料中类',
        field: 'middleCategory',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subCategory',
        width: 150,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 200,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 200,
    },
    {
        headerName: '所属区域',
        field: 'district',
        width: 200,
    },
    {
        headerName: '固定资产编号',
        field: 'numberId',
        width: 200,
    },
    {
        headerName: '入厂时间',
        field: 'joinFactoryTime',
        width: 200,
    },
    {
        headerName: '报废时间',
        field: 'scrapTime',
        width: 200,
    },
    {
        headerName: '折旧时长(月)',
        field: 'deprecitionTime',
        width: 200,
    },

    {
        headerName: '已折旧时长(月)',
        field: 'upDeprecitionTime',
        width: 200,
    },
    {
        headerName: '折旧差异',
        field: 'difference',
        width: 195,
    },
    {
        headerName: '报废方式',
        field: 'scrapWay',
        width: 200,
    },
    {
        headerName: '报废金额',
        field: 'scrapMoney',
        width: 200,
    },
    {
        headerName: '购入金额',
        field: 'joinMoney',
        width: 200,
    },
    {
        headerName: '处理状态',
        field: 'processedState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.processedState == 0
                    ? 'warning'
                    : params.processedState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.processedState == 0
                    ? '未处理'
                    : params.processedState == 1
                        ? '已处理'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '未处理'
                    : params.value == '1'
                        ? '已处理'
                        : ''
            },
        }
    },
]
let tableColumns5: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: false,
        pinned: 'left',
    },
    {
        headerName: '物料大类',
        field: 'bigClassName',
        width: 150,
    },
    {
        headerName: '物料中类',
        field: 'middleCategory',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subClassName',
        width: 150,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 150,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 150,
    },
    {

        headerName: '物料规格',
        field: 'specName',
        width: 150,
    },
    // {
    //     headerName: '物料类型',
    //     field: 'machineTypeName',
    //     width: 150,
    // },
    {
        headerName: '所属区域',
        field: 'areaName',
        width: 150,
    },
    {
        headerName: '数量',
        field: 'totalNum',
        width: 150,
    },
    {
        headerName: '单位',
        field: 'unit',
        width: 150,
    },
    // {
    //     headerName: '公司',
    //     field: 'firm',
    //     width: 150,
    // },
    // {
    //     headerName: '机台编号',
    //     width: 150,
    //     field: 'machineCode',
    // },
    // {
    //     headerName: '机台名称',
    //     width: 150,
    //     field: 'machineName',
    // },
    // {
    //     headerName: '机台类别',
    //     field: 'machineTypeName',
    //     width: 150,
    // },
    // {
    //     headerName: '位置号',
    //     width: 150,
    //     field: 'coordinate',
    // },
    // {
    //     headerName: '所属区域',
    //     width: 150,
    //     field: 'areaName',
    // },
    // {
    //     headerName: '折旧时间（月）',
    //     field: 'deprecitionTime',
    //     width: 200,
    // },
    // {
    //     headerName: '已折旧时间（月）',
    //     field: 'upDeprecitionTime',
    //     width: 200,
    // },
    // {
    //     headerName: '折旧差异（月）',
    //     field: 'difference',
    //     width: 200,
    // },
]
let tableColumns6: any = [
    {
        headerCheckboxSelection: false,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: true,
        pinned: 'left',
        checkboxSelection: (params) => {
            return !params.data && params.data.matchState != 0;
        },
    },
    {
        headerName: '物料大类',
        field: 'majorCategory',
        width: 150,
    },
    {
        headerName: '物料中类',
        field: 'middleCategory',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subCategory',
        width: 150,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 200,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 200,
    },
    {
        headerName: '所属区域',
        field: 'district',
        width: 200,
    },
    {
        headerName: '固定资产编号',
        field: 'numberId',
        width: 200,
    },
    {
        headerName: '入厂时间',
        field: 'joinFactoryTime',
        width: 200,
    },
    {
        headerName: '报废时间',
        field: 'scrapTime',
        width: 200,
    },
    {
        headerName: '折旧时长(月)',
        field: 'deprecitionTime',
        width: 200,
    },

    {
        headerName: '已折旧时长(月)',
        field: 'upDeprecitionTime',
        width: 200,
    },
    {
        headerName: '折旧差异',
        field: 'difference',
        width: 195,
    },
    {
        headerName: '报废方式',
        field: 'scrapWay',
        width: 200,
    },
    {
        headerName: '报废金额',
        field: 'scrapMoney',
        width: 200,
    },
    {
        headerName: '购入金额',
        field: 'joinMoney',
        width: 200,
    },
    {
        headerName: '处理状态',
        field: 'processedState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.processedState == 0
                    ? 'warning'
                    : params.processedState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.processedState == 0
                    ? '未处理'
                    : params.processedState == 1
                        ? '已处理'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '未处理'
                    : params.value == '1'
                        ? '已处理'
                        : ''
            },
        }
    },
]
let tableColumns7: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: true,
        pinned: 'left',
    },
    {
        headerName: '物料大类',
        field: 'bigClassName',
        width: 150,
    },
    {
        headerName: '物料中类',
        field: 'middleClassName',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subClassName',
        width: 150,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 200,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 200,
    },
    {
        headerName: '所属区域',
        field: 'areaName',
        width: 200,
    },
    {
        headerName: '报废方式',
        field: 'scrapType',
        width: 200,
    },
    {
        headerName: '报废金额',
        field: 'scrapMoney',
        width: 200,
    },
    {
        headerName: '处理状态',
        field: 'processedState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.processedState == 0
                    ? 'warning'
                    : params.processedState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.processedState == 0
                    ? '未处理'
                    : params.processedState == 1
                        ? '已处理'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '未处理'
                    : params.value == '1'
                        ? '已处理'
                        : ''
            },
        }
    },
]
let tableColumns10: any = [
    {
        headerCheckboxSelection: true,
        checkboxSelection: true,
        width: 60,
        showDisabledCheckboxes: true,
        pinned: 'left',
    },
    {
        headerName: '物料大类',
        field: 'bigClassName',
        width: 150,
    },
    {
        headerName: '物料中类',
        field: 'middleClassName',
        width: 150,
    },
    {
        headerName: '物料小类',
        field: 'subClassName',
        width: 150,
    },
    {
        headerName: '物料编号',
        field: 'materialCode',
        width: 200,
    },
    {
        headerName: '物料名称',
        field: 'materialName',
        width: 200,
    },
    {
        headerName: '所属区域',
        field: 'areaName',
        width: 200,
    },
    {
        headerName: '报废方式',
        field: 'scrapType',
        width: 200,
    },
    {
        headerName: '报废金额',
        field: 'scrapMoney',
        width: 200,
    },
    {
        headerName: '处理状态',
        field: 'processedState',
        width: 200,
        cellRenderer: tagRender,
        cellRendererParams: {
            styleClass: (params: any) => {
                return params.processedState == 0
                    ? 'warning'
                    : params.processedState == 1
                        ? 'success'
                        : ''
            },
            text: (params: any) => {
                return params.processedState == 0
                    ? '未处理'
                    : params.processedState == 1
                        ? '已处理'
                        : ''
            },
            eltagSize: 0,
        },
        filterParams: {
            valueFormatter: function (params: any) {
                return params.value == '0'
                    ? '未处理'
                    : params.value == '1'
                        ? '已处理'
                        : ''
            },
        }
    },
]
export {
    tableColumns,
    tableColumns1,
    tableColumns2,
    // tableColumns3,
    tableColumns4,
    tableColumns5,
    tableColumns6,
    tableColumns7,
    tableColumns10
}